(function(){
	
	var ModuleNamePrefix = 'AppView.sys.user.';
	var ModuleUrlPrefix = '/sys/user';
	
	Ext.define(ModuleNamePrefix + 'SysUserGridStore',{
		extend:'Ext.data.Store',
		autoLoad: true,
		fields: [
			{name:'orgId'},
			{name:'account'},
			{name:'userName'},
			{name:'sex'},
			{name:'telphone'},
			{name:'email'},
			{name:'isUse'},
			{name:'orgName'}
		],
		pageSize:20,
	    proxy: {
	        type: 'ajax',
	        url: ModuleUrlPrefix+'/queryByPage.do',
	        reader: {
	            type: 'json',
	            root: 'objectList',
	            totalProperty:'allCount'
	        }
	    }
	});
	
	Ext.define(ModuleNamePrefix + 'SysUserGrid',{
		extend:'AppView.base.BaseGrid',
		alias:'widget.sysusergrid',
		columns: [
	        { text: '账号',  dataIndex: 'account' ,flex: 1 },
	        { text: '姓名',  dataIndex: 'userName' ,flex: 1 },
	        
	        { text: '所属部门',  dataIndex: 'orgName' ,flex: 1 },
	        { text: '性别', dataIndex: 'sex', flex: 1 },
	        { text: '电话', dataIndex: 'telphone', flex: 1 },
	        { text: '邮件', dataIndex: 'email', flex: 1 },
	        { text: '是否启用', dataIndex: 'isUse', flex: 1,renderer:function(value){
	        	if(value==1){
	        		return '是'
	        	}else{
	        		return '否'
	        	}
	        }}
	    ],
	    moduleUrl:ModuleUrlPrefix,
	    gridStore:ModuleNamePrefix + 'SysUserGridStore',
	    editWin:ModuleNamePrefix+'SysUserWin',
	    initComponent:function(){
			this.callParent();
	    }
	})
})()

